{% extends 'base.html' %}
{%import '_macros.html' as macros%}
{%import '_macres.html' as macres%}
{% block title %}首页{% endblock %}
{% block head %}
<link rel="stylesheet" href="{{ url_for('static',filename='css/index.css') }}">
{% endblock %}
{% block shouye %}active{% endblock %}
{% block lbd %}
    <div id="myCarousel" class="carousel slide">
    <!-- 轮播（Carousel）指标 -->
    <ol class="carousel-indicators">
        {% for i in bb['page'] %}
             {% if loop.first %}
            <li data-target="#myCarousel" data-slide-to="{{ i }}" class="active"></li>
            {% else %}
            <li data-target="#myCarousel" data-slide-to="{{ i }}"></li>
            {% endif %}
    {% endfor %}
    </ol>
    <!-- 轮播（Carousel）项目 -->
    <div class="carousel-inner">
        {% for a in bb['list'][bb['page_len']]  %}
                 {% if loop.first %}
                    <div class="item active">
                        <img src="{{ url_for('static',filename=a['Route']) }}" alt="{{ a['name'] }}" style="width: 100%; height: 30%">
                    </div>
                {% else %}
                    <div class="item">
                        <img src="{{ url_for('static',filename=a['Route']) }}" alt="{{ a['name'] }}" style="width: 100%; height: 30%">
                    </div>
                {% endif %}
        {% endfor %}
    </div>
</div>
{% endblock %}
{% block ind %}
<div class="row">
        <div class="hd">
            原创区
            <a class="more" href="{{ url_for('Exhibition') }}">更多</a>
        </div>
      <ul class="sss" id="sss">
          {% for a in posts %}
              <li class="thumbnail">
                <div class="caption1" style="float: left;width:45%;height:290px;overflow:hidden">
                    <a href="{{ url_for('static', filename=a['photo'])}}" target="_blank"><img src="{{ url_for('static', filename=a['photo'])}}" style="margin:0;border:0;width:100%;height: auto;" alt="..." ></a>
                </div>
                    <div class="caption" style="float: right; width: 53%;">
                      <h3 class="p2" title="{{ a['name'] }}"><a href="{{ a['Address'] }}" target="_blank">{{ a['name'] }}</a></h3>
                      <p class="p2" title="{{ a['singer'] }}">歌手：{{ a['singer'] }}</p>
                      <p class="p2" title="{{ a['Lyrics'] }}">作词：{{ a['Lyrics'] }}</p>
                      <p class="p2" title="{{ a['Composer'] }}">作曲：{{ a['Composer'] }}</p>
                      <p class="p2" title="{{ a['Arranger'] }}">编曲：{{ a['Arranger'] }}</p>
                      <p class="p2" title="{{ a['Mix'] }}">混音：{{ a['Mix'] }}</p>
                      <p><a href="javascript:void(0)" class="click_pop" onclick="op({{ a['id'] }})">查看歌词</a></p>
                      <p style="text-align: right">
                          {% if session == {} %}
                              <a href="javascript:void(0)" onclick="alert('请先登录');" class="btn btn-primary" role="button">比心<span class="badge">{{ a['give_up'] }}</span></a>
                          {% else %}
                              <a href="javascript:void(0)" onclick="om({{ a['id'] }},{{ session['mid'] }})" class="btn btn-primary" role="button">比心<span class="badge" id="{{ a['id'] }}">{{ a['give_up'] }}</span></a>
{#                          {{ url_for('Dispose',id=a['id'],meth=1,mid=session['mid']) }}#}
                          {% endif %}
                          <a href="javascript:void(0)" onclick="alert('手下留情');" class="btn btn-default" role="button">比屎<span class="badge">0</span></a></p>
                    </div>
              </li>
          {% endfor %}
          <div class="bgPop"></div>
          <div class="pop">
              <div class="pop-content">
                  <p style="font-size:150%" id="textttt"></p>
              </div>
          </div>
          <script>
              $(document).ready(function () {
                  $('.bgPop').click(function () {
                      $('.bgPop,.pop').hide();
                  });
                  $('.click_pop').click(function () {
                      $('.bgPop,.pop').show();
                  });
              });
          </script>
      </ul>
    </div>
<div class="row">
    {% if posts != [] %}
        {{macros.pagination_widget(pagination,'index',Type='1')}}
    {% endif %}
</div>


<div class="row">
        <div class="hd">
            翻唱区
            <a class="more" href="{{ url_for('Exhibition_Cover') }}">更多</a>
        </div>
      <ul class="sss" id="sss">
          {% for a in posts1 %}
              <li class="thumbnail">
                  <div class="caption1" style="float: left;width:45%;height:290px;overflow:hidden">
                    <a href="{{ url_for('static', filename=a['photo'])}}" target="_blank"><img src="{{ url_for('static', filename=a['photo'])}}" style="margin:0;border:0;width:100%;height: auto;" alt="..." ></a>
                </div>
                  <div class="caption" style="float: right; width: 50%">
                  <h3 class="p2" title="{{ a['name'] }}"><a href="{{ a['Address'] }}" target="_blank">{{ a['name'] }}</a></h3>
                      <p class="p2" title="{{ a['singer'] }}">歌手：{{ a['singer'] }}</p>
                      <p class="p2" title="{{ a['Original_song'] }}">原唱：{{ a['Original_song'] }}</p>
                      <p><a href="javascript:void(0)" class="click_pop" onclick="op({{ a['id'] }})">查看歌词</a></p>
                      <p style="text-align: right">
                          {% if session == {} %}
                              <a href="javascript:void(0)" onclick="alert('请先登录');" class="btn btn-primary" role="button">比心<span class="badge">{{ a['give_up'] }}</span></a>
                          {% else %}
                              <a href="javascript:void(0)" onclick="om({{ a['id'] }},{{ session['mid'] }})" class="btn btn-primary" role="button">比心<span class="badge" id="{{ a['id'] }}">{{ a['give_up'] }}</span></a>
{#                          {{ url_for('Dispose',id=a['id'],meth=1,mid=session['mid']) }}#}
                          {% endif %}
                          <a href="javascript:void(0)" onclick="alert('手下留情');" class="btn btn-default" role="button">比屎<span class="badge">0</span></a></p>
                  </div>
              </li>
          {% endfor %}
{#          <div class="bgPop"></div>#}
{#          <div class="pop">#}
{#              <div class="pop-content">#}
{#                  <p style="font-size:150%" id="textttt"></p>#}
{#              </div>#}
{#          </div>#}
{#          <script>#}
{#              $(document).ready(function () {#}
{#                  $('.bgPop').click(function () {#}
{#                      $('.bgPop,.pop').hide();#}
{#                  });#}
{#                  $('.click_pop').click(function () {#}
{#                      $('.bgPop,.pop').show();#}
{#                  });#}
{#              });#}
{#          </script>#}
      </ul>

</div>
<div class="row">
    {% if posts1 != [] %}
        {{macres.pagination_widget(pagination1,'.index',Type='2')}}
    {% endif %}
</div>
{% endblock %}
{% block jsna %}
<script>
        function op(a) {
            jQuery.get("{{ url_for('workexib.create_2')}}", { Lyric: a}, function (cc) {
                    $('#textttt').html(cc.message);
                });
        }
{#        比心#}
        function om(id,mid) {
            jQuery.get("{{ url_for('Dispose')}}", { id: id, mid:mid, meth:1}, function (cc) {
                if (cc.state == 'success') {
                    alert("投票成功");
{#                    $('#give_up').innerText=cc.url;#}
                    document.getElementById(id).innerHTML=cc.url;
                }else if (cc.state == 'fail') {
                    alert(cc.message)
                }
            });
        }

</script>
{% endblock %}